<template>
    <div>
        最外层组件传递过来的值: {{ root.count }} <br />
        <el-button @click="addCount">
            click
        </el-button>
    </div>
</template>

<script>
export default {
    inject: ['root'],
    mounted () {
        console.log(this);
    },
    methods: {
        addCount () {
            this.root.addCount(1);
        },
    },
};
</script>

<style>

</style>
